unit Class_SYS000;

interface

uses
  SysUtils, Classes, DataEngine;

type
  TSYS000 = class(TBaseClass)
  public
    FAINITTERM: string;
    FAMOUNTDEC: Integer;
    FICCLASSLEN: string;
    FICCLOSE: Integer;
    FICCURTERM: Integer;
    FICCURYEAR: Integer;
    FPRICEDEC: Integer;
    ID: Integer;
    JMONTH: Extended;
    JRULE: Extended;
    JYEAR: Extended;
    LOCKEDBY: string;
    SUBSKH: string;
    NAME: string;
    MASTER: string;
    USEYEAR: Integer;
    USEMONTH: Integer;
    QYXZ: string;
    DMCD0: string;
    DMCD1: string;
    DMCD2: string;
    DMCD3: string;
    DMCD4: string;
    DMCD5: string;
    DMCD6: string;
    BWB: string;
    NIAN: Integer;
    YUE: Integer;
    CSHCLOSE: string;
    FARMETHOD: string;
    FARHZBL: Extended;
    FARCLOSE: Integer;
    FFACLASSLEN: string;
    FFAADJUST: Integer; 
    FFACURYEAR: string;
    FFACURTERM: string;
    MEMO: TStringStream;
    JZDATE: Integer;
    DELEGATE: string;
    DATAVER: string;
    SPLITYEAR: string;
    LASTBAKDATE: string;
    BAKDAY: Integer;
    CNCURYEAR: Integer;
    CNCURMONTH: Integer;
    CNNIAN: Integer;
    CNYUE: Integer;
  public
    function GetTablePrefix: string;
    function GetTableName(ATBName: string): string;

    destructor Destroy; override;
  end;

implementation

{ TSYS000 }

destructor TSYS000.Destroy;
begin
  FreeAndNil(MEMO);
  inherited;
end;

function TSYS000.GetTableName(ATBName: string): string;
begin
  Result := GetTablePrefix + ATBName;
end;

function TSYS000.GetTablePrefix: string;
begin
  Result := IntToStr(NIAN);
  if ID < 10 then Result := Result + '00';
  if (ID > 10) and (ID < 100) then Result := Result + '0';
  Result := Result + IntToStr(ID);
end;


end.
